<template>
  <div class="bgh" style="min-height:95vh;overflow:hidden">
    <div class="fm_h mgbt bgf">
      <img :src="userdata.avatarurl" class="userimg" />
      <div class="fm_h2">
        <span class="fs18">{{ userdata.actuainame }}</span>
        <p>
          <span>{{ userdata.identitydes }}</span>
          <!-- <span class="mui-icon mui-icon-arrowright"/> -->
        </p>
      </div>
    </div>
    <div>
      <ul class="mui-table-view" style="position:static">
        <li
          v-for="(item, index) in mineData"
          :key="index"
          class="mui-table-view-cell fs16"
          @click="goright(item)"
        >
          <a class="mui-navigate-right">
            <img :src="item.img" style="width:19px;margin:0 20px" />
            {{ item.name }}
          </a>
        </li>
        <li v-if="userdata.identity=='2'" class="mui-table-view-cell fs16" @click="goright2()">
          <a class="mui-navigate-right">
            <img :src="mineData2[0].img" style="width:19px;margin:0 20px" />
            {{ mineData2[0].name }}
          </a>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userdata2:[],
      showright: false,
      userdata: {},
      ts: this.newStore(),
      mineData: [
        {
          name: '账单',
          pathname: 'zdpage',
          img: 'images/zhangdan.png'
        },
        {
          name: '我的服务',
          pathname: 'ddpage',
          img: 'images/dingdan.png'
        },
        {
          name: '我的订单',
          pathname: 'forder',
          img: 'images/fuwu.png'
        }
      ],
      mineData2: [
        {
          name: '扫码验证',
          pathname: 'sm',
          img: 'images/saoma.png'
        }
      ]
    }
  },
  created() {
    this.getuserData()
    this.getAddress()
  },
  methods: {
        getAddress() {
      const req = {
        token: localStorage.getItem('token'),
        mailtype:'1'
      }
      this.spost(this.ts, 'orderc/getAddress', req).then(ts => {
        console.log(ts.d)
        this.userdata2 = ts.d.data
      })
    },
    getuserData() {
      const req = {
        token: localStorage.getItem('token')
      }
      this.spost(this.ts, '/Personal/personalDetail', req).then(ts => {
        console.log(ts.d)
        this.userdata = ts.d.data
      })
    },
    goright2() {
      this.$router.push({
        name: 'sm',
        query: {
          from: '我的',
          word: '扫码验证'
        }
      })
    },
    goright(item) {
      this.$router.push({
        name: item.pathname,
        query: {
          from: '我的',
          word: item.name
        }
      })
    }
  }
}
</script>

<style scoped>
.userimg {
  border-radius: 50%;
  height: 80px;
}
.fm_h {
  display: flex;
  justify-content: space-between;
  padding: 30px 30px;
  margin-bottom: 10px;
}
.fm_h2 {
  height: 80px;
  width: 66%;
}
.fm_h2 span {
  height: 40px;
  line-height: 40px;
  display: inline-block;
}
.fm_h2 p {
  width: 109%;
  display: flex;
  justify-content: space-between;
}
</style>
